package com.yunsc.admin.controller.market;

import com.yunsc.common.utils.PageResult;
import com.yunsc.common.utils.Result;
import com.yunsc.common.utils.SecurityUtil;
import com.yunsc.store.dto.QueryPageDTO;
import com.yunsc.store.entity.YunscUserPointsLogEntity;
import com.yunsc.store.service.YunscUserPointsLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-06-03 22:19
 */
@Api(tags = "积分管理")
@RestController
@RequestMapping("/market/points")
public class PointsController {

    @Resource
    private YunscUserPointsLogService userPointsLogService;

    // /market/points/log
    @ApiOperation(value = "积分日志", notes = "积分日志")
    @RequestMapping("/log")
    public Result<?> queryPointsLog(QueryPageDTO param) {
        Integer storeId = SecurityUtil.getCurrentStoreId();
        PageResult<YunscUserPointsLogEntity> userPointsLog = userPointsLogService.queryPointsLog(param, storeId);
        return Result.resultPageList(userPointsLog);
    }

}
